Skip to content

Fix dashboard chart not updating after sync#51

Merged
pineapplestrikesback merged 1 commit intomainfrom
claude/fix-dashboard-chart-sync-ZjST3
Jan 24, 2026
Merged

Fix dashboard chart not updating after sync#51
pineapplestrikesback merged 1 commit intomainfrom
claude/fix-dashboard-chart-sync-ZjST3

Conversation

@pineapplestrikesback
Copy link
Owner

@pineapplestrikesback pineapplestrikesback commented Jan 24, 2026

The WeeklyActivityChart uses useDailyStats hook with query key
['dailyStats', ...] which was not being invalidated when workouts
were synced, imported, or deleted. Added dailyStats query invalidation
to useHevySync, useDeleteWorkouts, and useEnhancedImport hooks.

Summary by CodeRabbit

  • Bug Fixes
    • Daily statistics now properly refresh after workout imports and synchronization operations.

✏️ Tip: You can customize this high-level summary in your review settings.

The WeeklyActivityChart uses useDailyStats hook with query key
['dailyStats', ...] which was not being invalidated when workouts
were synced, imported, or deleted. Added dailyStats query invalidation
to useHevySync, useDeleteWorkouts, and useEnhancedImport hooks.
@vercel
Copy link

vercel bot commented Jan 24, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
gym-analytics Ready Ready Preview, Comment Jan 24, 2026 8:51pm

@pineapplestrikesback pineapplestrikesback merged commit 812bd4a into main Jan 24, 2026
3 of 4 checks passed
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 24, 2026

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

Two React hooks are updated to invalidate the dailyStats query cache. useEnhancedImport adds a single dailyStats invalidation after workout import completes, while useHevySync introduces a DAILY_STATS_KEY constant and invalidates dailyStats cache following sync and delete operations.

Changes

Cohort / File(s) Summary
Daily Stats Query Invalidation
src/db/hooks/useEnhancedImport.ts, src/db/hooks/useHevySync.ts
Adds cache invalidation for dailyStats query: useEnhancedImport invalidates after import completion; useHevySync introduces DAILY_STATS_KEY constant and invalidates on sync success and deleteWorkouts success

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 Cache grows stale, but not for long,
A whisker-twitch, and stats refresh strong!
Fresh data dances through our hooks so fine,
Synchronization—that sweet, whimsical line.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants